<?php
include '../../conn.php';
$data = json_decode($HTTP_RAW_POST_DATA);
$sql = "select * from users_info
        where id = $data->userId
        limit 1";
$isUser = $pdo->getOne($sql);
if($isUser) {
    $time = date("y-m-d H:i:s",time());
    $sql = "insert into users_comment
            (level,content_id,comment_id,from_user_id,to_user_id,comment,create_time)
            values ($data->level,$data->id,$data->commentId,$data->userId,$data->toUserId,'$data->comment','$time')";
    $req = $pdo->query($sql);
}else {
    $arr = [
        "code" => 400,
        "desc" => '用户信息错误,请重试'
    ];
    echo json_encode($arr);
    exit;
}